def func():
    a = 'aabcddd'
    b = dict()
    for i in a:
        if b.get(i):
            b[i] = b.get(i)+1
        else:
            b[i] = 1
    b = sorted(b.items(),key=lambda x:x[1])
    min = b[0][1]
    c = []
    for i in b:
        if min == i[1]:
            c.append(i[0])
    d = ''
    for i in a:
        if i in c:
            d = d+''
        else:
            d = d+i
    print(d)



if __name__ == '__main__':
    """
    aabcddd
    """
    func()